/**
 * Created by CZ on 2017/4/6.
 */
module.exports = function ($scope,$interval,$state) {
    $rootScope.isShowFooter = false;
    //初始化页面（选择角色）
    $scope.RegisterPage = 0;
    //分别注册角色
    $scope.RegisterType = function(id){
        switch (id){
            case 0: $scope.RegisterForm = 0; break;
            case 1: $scope.RegisterForm = 1;break;
        }
        $scope.RegisterPage = 1; // 进入下一页(表单注册)
    };

    $scope.submitSchoolForm = function(School){
        console.log(School);
        //验证
        $scope.RegisterPage = 2; // 进入下一页(注册结果)

    };

    $scope.submitDeveloperForm = function(Developer){
        console.log(Developer);
        //验证
        $scope.RegisterPage = 2; // 进入下一页(邮箱验证)
    };

    $scope.submitEmailForm = function(Email){  //提交邮箱验证码
        console.log(Email);
        //验证
        $scope.RegisterPage = 3; // 进入下一页(学校注册等待审批)
        $scope.second = 10 ;
        var timer = $interval(function(){
            $scope.second -- ;
            if( $scope.second == 0){
                //停止定时器
                $interval.cancel(timer);
                $state.go('CloudPlatform.home')
            }
        },1000)
    };
};